<?php

namespace Hilaoyu\LaravelExtend\Services\ThirdPartyLogin\Drivers;

use Hilaoyu\Utils\Traits\ErrorsTrait;

/**
 * Created by laoyu.
 * User: hilaoyu@qq.com
 * Date: 2018/3/12
 * Time: 10:55
 */
abstract class  AbstractDriver
{
    use ErrorsTrait;


    /*
     * 生成第三方登录地址
     * */
    abstract public function buildLoginUrl($state = '');

    /*
     * 获取access_token
     * */
    abstract public function getAuthorization($code);

    /*
     * 获取第三方openid
     * */
    abstract public function getOpenId(array $authorization);

    /*
     * 获取第三方openid
     * */
    abstract public function getUnionId();

    /*
     * 获取第三方用户信息
     * */
    abstract public function getUserinfo($openid = '', $access_token = '');

    abstract public function getDriverName();

}
